/**
 * 
 */
package com.gr.staffpm.tasks.model;

import org.apache.wicket.PageParameters;
import org.apache.wicket.markup.html.link.Link;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;

import com.gr.staffpm.datatypes.Task;
import com.gr.staffpm.pages.tasks.ViewTask;


/**
 * @author Graham Rhodes 16 Jan 2011 16:52:09
 */
public class TaskLink extends Link<Task> {

    /**
     * @param id
     * @param model
     * @see org.apache.wicket.Component#Component(String, IModel)
     */
    public TaskLink(final String id, IModel<Task> model) {
        super(id, model);
    }

    /**
     * @param id
     * @param project
     */
    public TaskLink(String id, Task task) {
        super(id, new Model<Task>(task));
    }

    private static final long serialVersionUID = 1L;

    @Override
    public void onClick() {
        setResponsePage(new ViewTask(new PageParameters("id=" + String.valueOf(getModelObject().getTaskId()))));
    }
}
